/*
 * This file is a copy with some modifications of the SubstitutionRule from
 * the Apache Calcite project. The original code can be found at:
 * https://github.com/apache/calcite/blob/branch-1.23/core/src/main/java/org/apache/calcite/rel/rules/SubstitutionRule.java
 * The changes are about using the blazing package
 */

package com.blazingdb.calcite.rules;
import org.apache.calcite.rel.rules.TransformationRule;

/**
 * A rule that implements this interface indicates that the new RelNode
 * is typically better than the old one. All the substitution rules will
 * be executed first until they are done. The execution order of
 * substitution rules depends on the match order.
 */
public interface SubstitutionRule extends TransformationRule {

  /**
   * Whether the planner should automatically prune old node when
   * there is at least 1 equivalent rel generated by the rule.
   *
   * <p>Default is false, the user needs to prune the old node
   * manually in the rule.</p>
   */
  default boolean autoPruneOld() {
    return false;
  }
}
